﻿Imports System
Imports System.Workflow.ComponentModel.Design

Namespace System.Workflow.Activities
    Friend NotInheritable Class InterfaceTypeFilterProvider
        Implements ITypeFilterProvider
        ' Methods
        Public Sub New(ByVal serviceProvider As IServiceProvider)
            Me.serviceProvider = serviceProvider
        End Sub

        Public Function CanFilterType(ByVal type As Type, ByVal throwOnError As Boolean) As Boolean
            If (throwOnError AndAlso Not type.IsInterface) Then
                Throw New Exception(SR.GetString("Error_InterfaceTypeNotInterface", New Object() { "InterfaceType" }))
            End If
            Return type.IsInterface
        End Function


        ' Properties
        Public ReadOnly Property FilterDescription As String
            Get
                Return SR.GetString("InterfaceTypeFilterDescription")
            End Get
        End Property


        ' Fields
        Private serviceProvider As IServiceProvider
    End Class
End Namespace

